/*
 * Copyright (C), CVTE Electronics CO.Ltd 2022.
 * @File name:
 * @Author: Zuo Yiming(zuoyiming98@buaa.edu.cn)
 * @Version: V1.0
 * @Date: 2022-10-17 11:01:53
 * @Description:B样条测试
 * @Others: None
 * @History: <time>   <author>    <version >   <desc>
 */

#include "curves/include/b_spline.h"

using namespace std;

int main() {
  Eigen::Vector2f pp0(0.0f, 0.0f);
  Pt p0(pp0);
  Eigen::Vector2f pp1(1.0f, 3.0f);
  Pt p1(pp1);
  Eigen::Vector2f pp2(2.0f, 5.0f);
  Pt p2(pp2);
  Eigen::Vector2f pp3(3.0f, -2.0f);
  Pt p3(pp3);
  Eigen::Vector2f pp4(4.0f, 4.0f);
  Pt p4(pp4);
  Eigen::Vector2f pp5(5.0f, -3.0f);
  Pt p5(pp5);
  vector<Pt> ctrl_pts;
  ctrl_pts.emplace_back(pp0);
  ctrl_pts.emplace_back(pp1);
  ctrl_pts.emplace_back(pp2);
  ctrl_pts.emplace_back(pp3);
  ctrl_pts.emplace_back(pp4);
  ctrl_pts.emplace_back(pp5);

  BSpline b_spline_process;
  int order = 3;
  b_spline_process.GenerateBSplineCurve(order, ctrl_pts);
  system("pause");
  return 0;
}